﻿using HalconDotNet;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ImageToolLine
{
    public enum LineMeasureDir
    {
        BlackToWhite,
        WhiteToBlack
    }
    public enum MeasureSelect
    {
        all,
        first,
        last
    }
    [Serializable]
    public class ToolSetting
    {
        public HRegion regionIgnore;
        public ToolSetting()
        {

            RowCenter = 0.0;
            ColumnCenter = 0.0;
            Phi = 0.0;
            Length1 = 40.0;
            Length2 = 10.0;
            MeasureWidth = 5;
            MinScore = 0.5;
            Sigma = 1.0;
            Threshold = 3.0;
            MeasureDir = LineMeasureDir.BlackToWhite;
            ShowLine = true;
            MeasureNums = 20;
            MeasureSelect = MeasureSelect.all;
            regionIgnore=new HRegion();
            regionIgnore.GenEmptyObj();

        }
        [CategoryAttribute("LineSearch")]
        public double RowCenter
        {
            get;
            set;
        }
        [CategoryAttribute("CreateModel")]
        public double ColumnCenter
        {
            get;
            set;
        }
        [CategoryAttribute("CreateModel")]
        public double Phi
        {
            get;
            set;
        }
        [CategoryAttribute("CreateModel")]
        public double Length1
        {
            get;
            set;
        }
        [CategoryAttribute("CreateModel")]
        public double Length2
        {
            get;
            set;
        }

        [CategoryAttribute("SearchModel")]
        public double MeasureWidth
        {
            get;
            set;
        }
        [CategoryAttribute("MeasureSetting")]
        public double Sigma
        {
            get;
            set;
        }
        [CategoryAttribute("MeasureSetting")]
        public double Threshold
        {
            get;
            set;
        }

        [CategoryAttribute("MeasureSetting")]
        public LineMeasureDir MeasureDir
        {
            get;
            set;
        }
        [CategoryAttribute("MeasureSetting")]
        public MeasureSelect MeasureSelect
        {
            get;
            set;
        }
        [CategoryAttribute("MeasureSetting")]
        public double MinScore
        {
            get;
            set;
        }
        [CategoryAttribute("UI")]
        public bool ShowMeasureWnd
        {
            get;
            set;
        }
        [CategoryAttribute("UI")]
        public bool ShowMeasurePt
        {
            get;
            set;
        }
        [CategoryAttribute("UI")]
        public bool ShowMeasureResultLine
        {
            get;
            set;
        }
        [CategoryAttribute("MeasureSetting")]
        public int MeasureNums
        {
            get;
            set;
        }
        [CategoryAttribute("UI")]
        public bool ShowLine
        {
            get;
            set;
        }
        
    }
}
